<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html lang="en">
<head>
<title>ianalyse - Take a closer look at your project</title>
<style>
.main {
    float:left;
    margin-left:5em;
    margin-right:5em;
    text-align:left;
}

.main h1 {
    margin-bottom:0.5em;
}

.wikistyle p {
    line-height:1.5em !important;
    margin:1em 0 !important;
}

.wikistyle h2 {
    border-top:4px solid #E0E0E0 !important;
    font-size:150% !important;
    margin-top:1.5em !important;
    padding-top:0.5em !important;
}

.wikistyle h1, h2, h3, h4, h5, h6 {
    border:0 none !important;
}



.wikistyle pre,.wikistyle div {
    background-color:#F8F8FF !important;
    border:1px solid #DEDEDE !important;
    color:#444444 !important;
    font-size:90% !important;
    line-height:1.5em !important;
    margin:1em 0 !important;
    overflow:auto !important;
    padding:0.5em !important;
}

pre.terminal,div.terminal {
    -moz-background-clip:border !important;
    -moz-background-inline-policy:continuous !important;
    -moz-background-origin:padding !important;
    background:#444444 none repeat scroll 0 0 !important;
    color:white !important;
    font-size:0.9em !important;
    padding:1em !important;
}

</style>
</head>
<body>
<div id="content">
            <div class="main">
                <h1 id="create_conf">Configure Ianalyse</h1>
                <div class="wikistyle">
                    <h2>Create configuration files</h2>
                    <p>
                        Let's say you unzip the project into /home/khu/ianalyse, the confguration files need to be created under directory:
                    </p>

                    <pre class="terminal">/home/khu/ianalyse/configs</pre>
                    The configuration file should use .cfg as file extension, each file stands for one project in Ianalyse. You should be able to find a template file
                    named ianalyse.sample under the directory above.

                    You can easily create your first project by renaming your template like this:
                    <pre class="terminal">
$ cd /home/khu/ianalyse/configs
$ mv ianalyse.sample nightly-build.cfg
                    </pre>

                    <h2>Change the settings in configuration file</h2>
                    <p>There are only two sections in the file: [Basic] and [CSV]</p>

                    <h3>Sections: [Basic]</h3>

					<h4>For CruiseControl builds:</h4>
                    <p>The first option is the logdir, which should be pointed to the directory contains all the CruiseControl logs.
                    for example, if you have directory like this:</p>
            <pre class="terminal">
/var/logs
|____connectfour
| |____log20051209122103Lbuild.0.xml
| |____log20091011161151Lbuild.1.xml
| |____log20091011161557Lbuild.2.xml
| |____log20091011165733Lbuild.3.xml
| |____log20091011170008Lbuild.4.xml
| |____log20091011172237Lbuild.5.xml
| |____status.txt
            </pre>
            you should define the logdir option like this:
            <pre class="terminal">
[Basic]
logdir: /var/logs/connectfour
            </pre>
Another option under [Basic] section is builds, which means lastest N builds need be be analyzed, the default value is 30.
            <pre class="terminal">
[Basic]
logdir: /var/logs/connectfour
builds: 50
            </pre>

			<h4>For Cruise builds:</h4>
            <p>To configure Cruise builds in Ianalyse, you need a slightly different configuration file. First, the configuration filename should be mapped to Cruise stage level build or job level build by the following naming convention:</p>
    <pre class="terminal">
[pipeline_name]__[stage_name]__[job_name].cfg or [pipeline_name]__[stage_name].cfg 
    </pre>
<p>Note: Be aware that there are <strong>two underscores</strong> between name parts.</p>	

    <p>Then, you need to tell Ianalyse it's a Cruise build by specifying the type option, and the baseurl of Cruise server:</p>
<pre class="terminal">
[Basic]
type: Cruise
baseurl:  http://[cruise_host]:[cruise_port]/cruise 
</pre>

                    <h2>Sections: [CSV]</h2>
                    <p>The options defined here are used to tell ianalyse which value need to be exported to CSV file from log.xml, the key is column name, the value is XPATH, Let's see you have many log files like this, and you want to export projectname, build time, buildate to CSV.</p>
            <pre class="terminal">
&lt;cruisecontrol&gt;
  &lt;info&gt;
    &lt;property name="projectname" value="connectfour4" /&gt;
    &lt;property name="lastbuild" value="20091011201149" /&gt;

    &lt;property name="lastsuccessfulbuild" value="20091011201149" /&gt;
    &lt;property name="builddate" value="2009-10-13T14:03:24" /&gt;
    &lt;property name="cctimestamp" value="20091013220324" /&gt;
    &lt;property name="label" value="build.18" /&gt;
    &lt;property name="interval" value="300" /&gt;
    &lt;property name="lastbuildsuccessful" value="true" /&gt;

    &lt;property name="logdir" value="/Users/twer/Desktop/cruisecontrol-bin-2.8.2/logs/connectfour4" /&gt;
    &lt;property name="logfile" value="log20091013220324.xml" /&gt;
  &lt;/info&gt;
  &lt;build time="1 minute(s) 2 second(s)" error="exec error"&gt;
    &lt;target name="exec"&gt;
      &lt;task name="echa"&gt;

        &lt;message priority="error"/&gt;
      &lt;/task&gt;
    &lt;/target&gt;
  &lt;/build&gt;
&lt;/cruisecontrol&gt;
            </pre>

            You can define options under your [CSV] like this:

            <pre class="terminal">
[CSV]
project name: //property/[@name='projectname']/@value
buid time: //build/@time
start time: //property[@name='builddate']/@value
            </pre>

            Click the export button on ianalyse, you will get a CSV file :
            <pre class="terminal">
[CSV]
project name, buid time,start time
connectfour4, 1 minute(s) 2 second(s), 2009-10-13T14:03:24
            </pre>
            <h1 id="faq">FAQ</h1>
            <h3>I saw MISSING REPORTS on the screen, what does it mean, how to resolve it?</h3>
            <p>This means there is no report generate for you, after you got everything <a href="#create_conf">configured</a> properly, you can click the "generate this report NOW!" button to create reports.</p>

                </div>




            </div>


</div>
</body>
</html>
